<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
<%@include file="init.jsp" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<link rel="stylesheet" type="text/css" href="css/style.css" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Edit Producer Admin</title>
</head>
<body>
<div class="master-wrapper-content">
	<jsp:include page="heading.jsp"></jsp:include>
	<%
		System.out.println(session.getAttribute("roleId"));
		if(session.getAttribute("roleId") == null || String.valueOf(session.getAttribute("roleId")).equalsIgnoreCase("2")) {
			%>
				<h3 style="color: red">Không đủ quyền để truy cập</h3>
			<%
		}
		else {
	%>
	<jsp:include page="CategoryAdmin.jsp"></jsp:include>
	<div class="container-right">
		<%
			int producerId = Integer.valueOf(request.getParameter("producerId"));
			
			Producer producer = dataManager.getProducerWithProducerId(producerId);
			%>
			<form action="UpdateProducer" method="post">
				<input type="hidden" name="producerId" value="<%=String.valueOf(producerId) %>" /> 
				<table>			
					<tr>
						<td>Producer Name : </td>
						<td><input type="text" name="producerName" value="<%=producer.getProducerName() %>" /></td>
					</tr>
					<tr>
						<td><input type="submit" value="Edit Producer" /></td>
					</tr>
				</table>
			</form>
			<%
		%>
	</div>
	<div class="clear"></div>
	<%
		}
	%>
</div>
</body>
</html>